package com.douyu.data.common;

import java.io.Serializable;
import java.util.Date;

public class Result<T> implements Serializable {
    private String status;
    private String time;
    private String error;
    private T result;

    public Result<T> ok(){
        this.setStatus("200");
        this.setTime(new Date().toString());
        this.setError("");
        return this;

    }

    public Result<T> ng(String message){
        this.setStatus("200");
        this.setTime(new Date().toString());
        this.setError(message);
        return this;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getTime() {
        return time;
    }

    public void setTime(String time) {
        this.time = time;
    }

    public String getError() {
        return error;
    }

    public void setError(String error) {
        this.error = error;
    }

    public T getResult() {
        return result;
    }

    public void setResult(T result) {
        this.result = result;
    }
}
